﻿using System.Xml.Serialization;
using EscapeZone.Interfaces;
using Microsoft.Xna.Framework;
using XnaPlus.Common.Extensions;

namespace EscapeZone.Mapping.Elements
{
    [XmlType("GoalZone")]
    public class GoalZone : IColorable
    {
        [XmlIgnore]
        public Vector2 Position { get { return Rect.TopLeft().ToVector(); } }

        [XmlElement]
        public Rectangle Rect { get; set; }

        [XmlIgnore]
        public Color Color { get; set; }

        public GoalZone()
        {
            Color = Color.Yellow;
        }

        public ElementType Type
        {
            get { return ElementType.GoalZone; }
        }
    }
}
